function ajusteVertical() {
  $(".num").each(function(index) { 
    $(this).css('padding-top', ($(this).width() - $(this).height()) / 2 + 'px');
	$(this).css('padding-bottom', ($(this).width() - $(this).height()) / 2 + 'px');
	console.log($(this).width() + ',' +  $(this).height() + ':' +  $(this).html());
  });

  $(".droppable").each(function(index) { 
    $(this).css('padding-top', ($(this).width() - $(this).height()) / 2 + 'px');
	$(this).css('padding-bottom', ($(this).width() - $(this).height()) / 2 + 'px');
	console.log($(this).width() + ',' +  $(this).height());
  });
}

(function($, undefined) {
  
  $(document).ready(function() {
    
    $('.draggable').draggable({
            revert: true,
            helper: 'clone',
            appendTo: '#divhelper'
  })
    
    $('.droppable').droppable({
      activeClass: 'ui-state-hover',
      hoverClass: 'ui-state-active',
      drop: function(e, ui) {
        var target = $(this).attr('rel');
        var val = ui.draggable.html().replace("-", "");
        $(this).parent().parent().find('input.'+target).val(val);
        $(this).html(val);
        $('#btnSubmit').attr('disabled', false);
      }
    });
    
  });
  
})(window.jQuery);

$(window).load(function() {
  ajusteVertical();
});

$(window).resize(function() {
  ajusteVertical();
});